package priv.ln.team.domain;

import java.util.Objects;

/**
 * ClassName: Designer
 * Package: priv.ln.team.domain
 * Description:
 *
 * @Author 辣辣
 * @Create 2025/4/17 18:33
 * @Version 1.0
 */
public class Designer extends Programmer{
    private double bonus;

    public Designer(int id, String name, int age, double salary, Equipment equipment, double bonus) {
        super(id, name, age, salary, equipment);
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public String toString() {
        return super.getInfo() + "\t\t设计师\t" + getStatus() + "\t" + bonus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Designer designer = (Designer) o;
        return Double.compare(bonus, designer.bonus) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), bonus);
    }
}
